package com.iweb.test;

import javax.servlet.*;
import java.io.IOException;

/**
 * ClassName: HelloFilter
 * Package: com.iweb.test
 * Description:
 *
 * @Author Jerry
 * @Create 2024/8/8 14:15
 * @Version 1.0
 */
public class HelloFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
        //System.out.println("过滤器初始化");
    }

    @Override
    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse, FilterChain filterChain) throws IOException, ServletException {
        System.out.println("拦截到了一个请求");
        filterChain.doFilter(servletRequest,servletResponse);
    }

    @Override
    public void destroy() {
        //System.out.println("过滤器被销毁");
    }
}
